<#--<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>-->
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>修改密码</title>
    <#include "../common/link.ftl">

</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
    <#include "../common/navbar.ftl">
    <!--菜单回显-->
    <c:set var="currentMenu" value="employee"/>
    <#assign currentMenu="emploee"/>
    <#include "../common/menu.ftl">
    <div class="content-wrapper">
        <section class="content-header">
            <h1>修改密码</h1>
        </section>
        <section class="content">
            <div class="box" style="padding: 30px;" >
                <!--高级查询--->
                <form class="form-horizontal" action="/employee/updatePwd.do" method="post" id="editForm" >
                    <input type="hidden" name="id">
                    <div class="form-group" style="margin-top: 10px;">
                        <label  class="col-sm-3 control-label">原密码：</label>
                        <div class="col-sm-6">
                            <input type="password" class="form-control"  name="oldPassword"
                                   placeholder="请输入原密码">
                        </div>
                    </div>
                    <div class="form-group" style="margin-top: 10px;">
                        <label class="col-sm-3 control-label">新密码：</label>
                        <div class="col-sm-6">
                            <input type="password" class="form-control"  name="newPassword"
                                   placeholder="请输入新密码">
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-3 col-sm-6">
                            <button id="submitBtn" type="button" class="btn btn-primary">确定修改</button>
                        </div>
                    </div>
                </form>

                <script>

                    $("#submitBtn").click(function () {

                        var oldPassword = $("input[name=oldPassword]").val();
                        var newPassword = $("input[name=newPassword]").val();

                        $.messager.confirm("警告","是否确认修改?",function () {
                            $.post("/employee/updatePwd.do", {oldPassword:oldPassword, newPassword:newPassword}, function (data) {
                                if (data.success) {
                                    $.messager.alert("温馨提示", "保存成功！2s后自动关闭");
                                    setTimeout(function () {
                                        window.location.href = "/login.html";
                                    }, 2000);
                                } else {
                                    $.messager.popup(data.msg);
                                }
                            });
                        });
                    });

                </script>

            </div>
        </section>
    </div>
    <#include "../common/footer.ftl">
</div>
</body>
</html>
